home *** CD-ROM | disk | FTP | other *** search
/ Precision Software Appli…tions Silver Collection 3 / Precision Software Applications Silver Collection Volume Three (PSM) (1993).iso / music2 / modified.arj / MODFORM.DOC < prev    next >
Text File  |  1991-06-06  |  5KB  |  125 lines

  1. Subject: Amiga modules formaat
  2.  
  3. Have you ever wondered how a Protracker 1.1B module is built up?
  4.  
  5. Well, here's the...
  6.  
  7. Protracker 1.1B Song/Module Format:
  8. -----------------------------------
  9.  
  10. Offset  Bytes  Description
  11. ------  -----  -----------
  12.    0     20    Songname. Remember to put trailing null bytes at the end...
  13.  
  14. Information for sample 1-31:
  15.  
  16. Offset  Bytes  Description
  17. ------  -----  -----------
  18.   20     22    Samplename for sample 1. Pad with null bytes.
  19.   42      2    Samplelength for sample 1. Stored as number of words.
  20.                Multiply by two to get real sample length in bytes.
  21.   44      1    Lower four bits are the finetune value, stored as a signed
  22.                four bit number. The upper four bits are not used, and
  23.                should be set to zero.
  24.                Value:  Finetune:
  25.                  0        0
  26.                  1       +1
  27.                  2       +2
  28.                  3       +3
  29.                  4       +4
  30.                  5       +5
  31.                  6       +6
  32.                  7       +7
  33.                  8       -8
  34.                  9       -7
  35.                  A       -6
  36.                  B       -5
  37.                  C       -4
  38.                  D       -3
  39.                  E       -2
  40.                  F       -1
  41.  
  42.   45      1    Volume for sample 1. Range is $00-$40, or 0-64 decimal.
  43.   46      2    Repeat point for sample 1. Stored as number of words offset
  44.                from start of sample. Multiply by two to get offset in bytes.
  45.   48      2    Repeat Length for sample 1. Stored as number of words in
  46.                loop. Multiply by two to get replen in bytes.
  47.  
  48. Information for the next 30 samples starts here. It's just like the info for
  49. sample 1.
  50.  
  51. Offset  Bytes  Description
  52. ------  -----  -----------
  53.   50     30    Sample 2...
  54.   80     30    Sample 3...
  55.    .
  56.    .
  57.    .
  58.  890     30    Sample 30...
  59.  920     30    Sample 31...
  60.  
  61. Offset  Bytes  Description
  62. ------  -----  -----------
  63.  950      1    Songlength. Range is 1-128.
  64.  951      1    Well... this little byte here is set to 127, so that old
  65.                trackers will search through all patterns when loading.
  66.                Noisetracker uses this byte for restart, but we don't.
  67.  952    128    Song positions 0-127. Each hold a number from 0-63 that
  68.                tells the tracker what pattern to play at that position.
  69. 1080      4    The four letters "M.K." - This is something Mahoney & Kaktus
  70.                inserted when they increased the number of samples from
  71.                15 to 31. If it's not there, the module/song uses 15 samples
  72.                or the text has been removed to make the module harder to
  73.                rip. Startrekker puts "FLT4" or "FLT8" there instead.
  74.  
  75. Offset  Bytes  Description
  76. ------  -----  -----------
  77. 1084    1024   Data for pattern 00.
  78.    .
  79.    .
  80.    .
  81. xxxx  Number of patterns stored is equal to the highest patternnumber
  82.       in the song position table (at offset 952-1079).
  83.  
  84. Each note is stored as 4 bytes, and all four notes at each position in
  85. the pattern are stored after each other.
  86.  
  87. 00 -  chan1  chan2  chan3  chan4
  88. 01 -  chan1  chan2  chan3  chan4
  89. 02 -  chan1  chan2  chan3  chan4
  90. etc.
  91.  
  92. Info for each note:
  93.  
  94.  _____byte 1_____   byte2_    _____byte 3_____   byte4_
  95. /                \ /      \  /                \ /      \
  96. 0000          0000-00000000  0000          0000-00000000
  97.  
  98. Upper four    12 bits for    Lower four    Effect command.
  99. bits of sam-  note period.   bits of sam-
  100. ple number.                  ple number.
  101.  
  102. Periodtable for Tuning 0, Normal
  103.   C-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453
  104.   C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226
  105.   C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113
  106.  
  107. To determine what note to show, scan through the table until you find
  108. the same period as the one stored in byte 1-2. Use the index to look
  109. up in a notenames table.
  110.  
  111. This is the data stored in a normal song. A packed song starts with the
  112. four letters "PACK", but i don't know how the song is packed: You can
  113. get the source code for the cruncher/decruncher from us if you need it,
  114. but I don't understand it; I've just ripped it from another tracker...
  115.  
  116. In a module, all the samples are stored right after the patterndata.
  117. To determine where a sample starts and stops, you use the sampleinfo
  118. structures in the beginning of the file (from offset 20). Take a look
  119. at the mt_init routine in the playroutine, and you'll see just how it
  120. is done.
  121.  
  122. Lars "ZAP" Hamre/Amiga Freelancers
  123.  
  124.  
  125.